import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({


    state: {
        userMsg: {},
        menu: [],
        menu1: [],
        menu2: [],
        menu3: [],
    },
    getters: {


    },
    mutations: {
        setUserMsg(state, obj) {
            state.userMsg = {...obj }

        },
        setUserMenu(state, arr) {

            state.menu = arr
            arr.map(item => {
                if (item.meta.yuyue) {
                    state.menu1.push(item)
                }
                if (item.meta.yiyuan) {
                    state.menu2.push(item)
                }
                if (item.meta.rlue) {
                    state.menu3.push(item)
                }

            })

            arr.shift()



        }
    },
    actions: {},
    modules: {}
})